﻿using Sunny.UI;
using LeederWinApp.Model;
using LeederWinApp.Business;

namespace LeederWinApp
{
    public partial class FLogin : UILoginForm
    {
        UserBLL userBLL = new UserBLL();
        public UserModel user { get; set; }
        public FLogin()
        {
            InitializeComponent();
        }
        private void FLogin_ButtonLoginClick(object sender, System.EventArgs e)
        {
             user = userBLL.Login(UserName, Password);
            //UserName就是封装了界面里用户名输入框的值
            //Password就是封装了界面里密码输入框的值
            if (user != null)
            {
                IsLogin = true;
                Close();
            }
            else
            {
                ShowErrorTip("用户名或者密码错误。");
            }
        }

    }
}
